<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/page/base.jsp"%>
<%@ taglib prefix="d" uri="/doone-comm-ui-tags"%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<base href="<%=basePath%>"></base>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title></title>
		<!-- Libraries -->
		<link type="text/css" href="<%=path%>/manage/css/layout.css" rel="stylesheet" />
        <link type="text/css" href="<%=path%>/manage/css/new_style.css" rel="stylesheet" />

		<script type="text/javascript"
			src="<%=path%>/manage/js/jquery-1.4.4.min.js"></script>
		<script type="text/javascript"
			src="<%=path%>/manage/js/easyTooltip.js"></script>
		<script type="text/javascript"
			src="<%=path%>/manage/js/jquery-ui-1.8.11.custom.min.js"></script>
		<script type="text/javascript"
			src="<%=path%>/manage/js/jquery.wysiwyg.js"></script>
		<script type="text/javascript"
			src="<%=path%>/manage/js/hoverIntent.js"></script>
		<script type="text/javascript" src="<%=path%>/manage/js/superfish.js"></script>
		<script type="text/javascript" src="<%=path%>/manage/js/custom.js"></script>
		<script type="text/javascript"
			src="<%=path%>/manage/js/My97DatePicker/WdatePicker.js"></script>
		<sx:head />
		<script language="javascript" type="text/javascript">
	function openClient(intUserId) {
		//应用编辑
		$.ajax({
			url : root + '/clientuser/getClientUser.action',
			method : 'post',
			dataType : 'json',
			data : {
				'intUserId' : intUserId
			},
			success : function(data) {
				$("#intUserId").attr("value", data.intUserId);
				$("#varUserName").attr("value", data.varUserName);
				$("#intAppId").attr("value", data.intAppId);
				$("#intUserSex").attr("value", data.intUserSex);
				$("#datUserBirthday").attr("value", data.datUserBirthday);
				$("#varUserLoginName").attr("value", data.varUserLoginName);
				$("#varUserLoginPassword").attr("value",
						data.varUserLoginPassword);
				$("#varUserPhonenum").attr("value", data.varUserPhonenum);
				$("#varUserWeiboAccount").attr("value",
						data.varUserWeiboAccount);
				$("#varNickName").attr("value", data.varNickName);
				$("#varDeviceId").attr("value", data.varDeviceId);
				$("#varImsi").attr("value", data.varImsi);
				$("#varOsType").attr("value", data.varOsType);
				$("#intDeleteSign").attr("value", data.intDeleteSign);
				$("#openClientDialog").dialog("open");
			},
			error : function(err) {
				if (err.responseText != '')
					alert(err.responseText);
				else
					alert("请求失败！");
			}
		});

	}

	$(document).ready(function() {

		//加载消息编辑dialog
		$("#openClientDialog").dialog({
			autoOpen : false,
			width : 420,
			height : 350,
			modal : true,
			title : '会员编辑',
			buttons : {
				"保存" : function() {
				   if(!openClientform.valid()){
				   alert("验证没通过，数据无法保存据");
				   }else{
					$("#openClientform").submit();
					$(this).dialog("close");
					}
				},
				"取消" : function() {
					$(this).dialog("close");
					$("#openClientform")[0].reset();
				}
			},
			close : function() {
				$("#openClientform")[0].reset();
			}

		});
		//验证

		var openClientform = $("#openClientform").validate({
			rules : {
				"orderInfo.dobOrderMoney" : {
					required : true
				},
				"orderInfo.datOrderDatetime" : {
					required : true
				},
				"orderInfo.intOrderCount" : {
					required : true
				}
			},
			messages : {
				"orderInfo.dobOrderMoney" : {
					required : "请输入订单金额"
				},
				"orderInfo.datOrderDatetime" : {
					required : "请输入下单时间"
				},
				"orderInfo.intOrderCount" : {
					required : "请输入商品数量"

				}
			}

		});
	});
	//删除订单
	function delClient(intUserId) {
		if (confirm("慎重考虑是否确定删除该记录?删除后无法查看该条记录！！！")) {
			$.ajax({
				url : root + '/clientuser/delClientUser.action',
				method : 'post',
				data : {
					'intUserId' : intUserId
				},
				success : function(data) {
					alert("删除成功");
					window.location.href = root
							+ '/clientuser/getClientUserPage.action';
				},
				error : function(err) {
					if (err.responseText != '')
						alert(err.responseText);
					else
						alert("请求失败！");
				}
			});
		}
	}
</script>

	</head>

	<body>

		<div >
			<p class="sitemap">
				当前位置：会员信息管理 > 会员管理
			</p>
			<h1>
				会员管理
			</h1>
			<div >

				<!-- Tabs -->
				<div id="tabs">
					<ul>
						<li>
							<a href="#tabs-1">会员内容列表</a>
						</li>

					</ul>
					<!-- 检索 -->
					<div>
						<form name="searchForm" id="searchForm" method="post"
							action="<%=path%>/clientuser/getClientUserPage.action" style="margin:10px 0;">
							用户名:
							<s:textfield name="condition.varUserName"></s:textfield>
							<input type="submit" id="searchBtn" value="检索">
						</form>

					</div>
					<!-- 检索 END-->
					<!-- First tab -->
					<table cellspacing="0" cellpadding="0" border="0" class="fullwidth">
						<thead>
							<tr>
								<td>
									用户编号
								</td>
								<td width="150px;">
									用户名
								</td>
								<td>
									用户电话号码
								</td>
								<td>
									登录名称
								</td>
								<td>
									用户微博账号
								</td>
								<td>
									昵称
								</td>
								<td>
									设备ID
								</td>
								<td>
									操作
								</td>
							</tr>
						</thead>
						<tbody>
							<s:iterator value="clientUserList">
								<tr class="odd">
									<td>
										<s:property value="intUserId" />
									</td>
									<td>
										<s:property value="varUserName" />
									</td>
									<td>
										<s:property value="varUserPhonenum" />
									</td>
									<td>
										<s:property value="varUserLoginName" />
									</td>
									<td>
										<s:property value="varUserWeiboAccount" />
									</td>
									<td>
										<s:property value="varNickName" />
									</td>
									<td>
										<s:property value="varDeviceId" />
									</td>
									<td>


										<a class="icon icon_edit" title="编辑 "  href="javascript:openClient('<s:property value="intUserId" />')"> </a>
										<a class="icon icon_delete" title="删除" href="javascript:delClient('<s:property value="intUserId" />')"></a>
									</td>
								</tr>
							</s:iterator>

						</tbody>
					</table>
					<!-- End of Tabs -->
				</div>
				<!-- 分页标签开始 -->
				<div align="right" style="float: right;">
					<d:page id="page" template="details" skin="gray">
					</d:page>
				</div>
				<!-- 分页标签结束 -->
				<hr />
			</div>
		</div>





		<!-- 编辑页使用的弹出层 -->
		<div id="openClientDialog" style="display: none;">

			<form id="openClientform" action="<%=path%>/order/editOrder.action"
				method="post">
				<input type="hidden" name="clientUserInfo.intAppId" id="intAppId"
					value="">
				<input type="hidden" name="clientUserInfo.intDeleteSign"
					id="intDeleteSign" value="">
				<input type="hidden" name="clientUserInfo.intUserId" id="intUserId">
				<table class="fullwidth" cellpadding="0" cellspacing="0" border="0">
					<tr>
						<td>
							用户名
						</td>
						<td>
							<input type="text" name="clientUserInfo.varUserName"
								id="varUserName" readonly="readonly">
						</td>
					</tr>
					<tr>
						<td>
							昵称
						</td>
						<td>
							<input type="text" name="clientUserInfo.varNickName"
								id="varNickName">
						</td>
					</tr>
					<tr>
						<td>
							性别
						</td>
						<td>
							<input type="text" name="clientUserInfo.intUserSex"
								id="intUserSex">
						</td>
					</tr>
					<tr>
						<td>
							生日
						</td>
						<td>
							<input type="text" name="clientUserInfo.datUserBirthday"
								id="datUserBirthday">
						</td>
					</tr>
					<tr>
						<td>
							用户登录名
						</td>
						<td>
							<input type="text" name="clientUserInfo.varUserLoginPassword"
								id="varUserLoginPassword">
						</td>
					</tr>
					<tr>
						<td>
							用户登录密码
						</td>
						<td>
							<input type="text" name="clientUserInfo.varUserLoginPassword"
								id="varUserLoginPassword">
						</td>
					</tr>

					<tr>
						<td>
							联系电话
						</td>
						<td>
							<input type="text" name="clientUserInfo.varUserPhonenum"
								id="varUserPhonenum">
						</td>
					</tr>
					<tr>
						<td>
							微博账号
						</td>
						<td>
							<input type="text" name="clientUserInfo.varUserWeiboAccount"
								id="varUserWeiboAccount">
						</td>
					</tr>
					<tr>
						<td>
							设备ID
						</td>
						<td>
							<input type="text" name="clientUserInfo.varDeviceId"
								id="varDeviceId">
						</td>
					</tr>
					<tr>
						<td>
							IMSI
						</td>
						<td>
							<input type="text" name="clientUserInfo.varImsi" id="varImsi">
						</td>
					</tr>
					<tr>
						<td>
							系统类型
						</td>
						<td>
							<input type="text" name="clientUserInfo.varOsType" id="varOsType">
						</td>
					</tr>
				</table>
			</form>
		</div>
		<div id="addClientDialog" style="display: none;">

			<form id="addClientform"
				action="<%=path%>/order/addClientUser.action" method="post">
				<table class="fullwidth" cellpadding="0" cellspacing="0" border="0">
					<tr>
						<td>
							用户名
						</td>
						<td>
							<input type="text" name="clientUseraddInfo.varUserName"
								readonly="readonly">
						</td>
					</tr>
					<tr>
						<td>
							昵称
						</td>
						<td>
							<input type="text" name="clientUseraddInfo.varNickName">
						</td>
					</tr>
					<tr>
						<td>
							性别
						</td>
						<td>
							<input type="text" name="clientUseraddInfo.intUserSex">
						</td>
					</tr>
					<tr>
						<td>
							生日
						</td>
						<td>
							<input type="text" name="clientUseraddInfo.datUserBirthday">
						</td>
					</tr>
					<tr>
						<td>
							用户登录名
						</td>
						<td>
							<input type="text" name="clientUseraddInfo.varUserLoginPassword">
						</td>
					</tr>
					<tr>
						<td>
							用户登录密码
						</td>
						<td>
							<input type="text" name="clientUseraddInfo.varUserLoginPassword">
						</td>
					</tr>

					<tr>
						<td>
							联系电话
						</td>
						<td>
							<input type="text" name="clientUseraddInfo.varUserPhonenum">
						</td>
					</tr>
					<tr>
						<td>
							微博账号
						</td>
						<td>
							<input type="text" name="clientUseraddInfo.varUserWeiboAccount">
						</td>
					</tr>
					<tr>
						<td>
							设备ID
						</td>
						<td>
							<input type="text" name="clientUseraddInfo.varDeviceId">
						</td>
					</tr>
					<tr>
						<td>
							IMSI
						</td>
						<td>
							<input type="text" name="clientUseraddInfo.varImsi">
						</td>
					</tr>
					<tr>
						<td>
							系统类型
						</td>
						<td>
							<input type="text" name="clientUseraddInfo.varOsType">
						</td>
					</tr>
				</table>
			</form>
		</div>
	</body>
</html>
